<?php

$table_source = $old_nav_db_config['DB_PREFIX'].'goods_cate';

$table_target = $db_config['DB_PREFIX'].'goods_cate';



$db_target->query("TRUNCATE $table_target");

$data_list = $db_source->query("SELECT * FROM $table_source");

showjsmessage("开始转换数据表　goods_cate",2);

$data_count = count($data_list);

$fields = array_keys($data_list[0]);

$start_sql = "INSERT INTO $table_target ( `" . implode('`, `', $fields) . '` ) VALUES ';



for($j=0; $j< $data_count; $j++)

{

	$data = $data_list[$j];

	$record = array_map('dumpEscapeString', $data);//过滤非法字符

	$sql = $start_sql . ' ('. implodeInsertValues($record) .')';

	$db_target->query($sql);

}



showjsmessage("转换数据表　goods_cate ... 成功");

showjsmessage(U('Index/convert',array('table'=>'group_city','begin'=>0)),5);

?>